import React,{ Component,Fragment } from 'react'
import { HeadContainer } from './HeadStyle';
import HomeCommon from 'pages/home/HomeCommon'

class Head extends Component{
  
    go = () => {
        this.props.history.go(-1)
    }
    goHome = () => {
        this.props.history.push('/home')
    }

    render () {
        return(
            <Fragment>
                
                <HeadContainer>
                <div className="home">
                    <p className="p1" onClick={ this.go } > <i className=" fa fa-angle-left "> </i> </p>
                    <p className="p2">{ this.props.title1 || this.props.title }</p>
                    <p className="p3" onClick={ this.goHome } > <i className=" fa fa-home "> </i> </p>
                </div>      
                </HeadContainer>
                
            </Fragment>
            
        )
    }
}

export default HomeCommon(Head)